<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of editGrid
 *
 * @author Administrator
 */
class editGrid extends WMS_Controller
{

    public function __construct()
    {
        parent::__construct();
        $this->load->service('wms/grid_service');
        $userData = $this->session->userdata('users');
        if (empty($userData['user_main_whs_code']))
        {
            redirect(blang_url());
        }
        $this->whsCode = $userData['user_main_whs_code'];
    }

    public function add()
    {
        $gp = gp();
        $whs_code = $gp['whs_code'];
        $frame_prefix = $gp['frame_prefix'];
        $at_row = $gp['at_row'];
        $at_col = $gp['at_col'];
        $grid_name = $gp['grid_name'];
        $grid_description = $grid_name;
        if ('' != $frame_prefix || '' != $at_row || '' != $at_col || '' != $grid_name)
        {
            echo '{"success":false,"msg":"'.lang('wms_tips_20016').'"}';
            exit;
        }
        $rs = $this->grid_service->addFromDetail($whs_code, $frame_prefix, $at_row, $at_col, $grid_name, $grid_description);
        if ($inser)
        {
            echo '{"success":true,"msg":"' . $whs_code . '/' . $frame_prefix . $at_row . '_' . $at_col . '@' . $grid_name . '"}';
        }
        else
        {
            echo '{"success":false,"msg":"'.lang('wms_tips_20016').'"}';
        }
    }

}

?>
